package com.zh.freechat.common.req;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

import static com.zh.mycommon.value.RegexpConst.REGEX_PHONE;


/**
 * chat账号注册表单
 *
 * @author ZH
 * @date 14:57 2021-01-10
 */
@Data
public class ChatUserForm implements Serializable {
    @Length(max = 20)
    @NotEmpty(message = "用户名不能为空")
    private String username;

    @Length(max = 20)
    private String nickname;

    @Length(max = 50)
    @NotEmpty(message = "密码不能为空")
    private String password;

    @Pattern(regexp = REGEX_PHONE)
    private String phone;

    @Email
    private String email;

    /**
     * 验证码
     */
    @NotEmpty(message = "验证码不能为空")
    private String code;

}
